package com.hospital.hospitalsystem.modules.medicine.controller;

import com.hospital.hospitalsystem.base.BaseResponse;
import com.hospital.hospitalsystem.base.PageData;
import com.hospital.hospitalsystem.config.TokenVerify;
import com.hospital.hospitalsystem.modules.medicine.biz.HospitalMedicalHistoryBiz;
import com.hospital.hospitalsystem.modules.medicine.dto.HospitalMedicalHistoryListReq;
import com.hospital.hospitalsystem.modules.medicine.dto.HospitalMedicalHistoryRsp;
import com.hospital.hospitalsystem.modules.medicine.dto.HospitalMedicalListReq;
import com.hospital.hospitalsystem.modules.medicine.dto.HospitalMedicalRsp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/4/7
 */
@RestController
@RequestMapping("/medicine")
@Api(tags = "抓药师历史操作记录")
@Validated
public class HospitalMedicalHistoryController {

    @Autowired
    private HospitalMedicalHistoryBiz hospitalMedicalHistoryBiz;

    @ApiOperation(value = "获取操作历史")
    @RequestMapping(path = "/get-history",method = RequestMethod.POST)
    @TokenVerify(type = "medicine")
    public BaseResponse<PageData<HospitalMedicalHistoryRsp>> getMedical(@RequestBody HospitalMedicalHistoryListReq req){
        PageData<HospitalMedicalHistoryRsp> result = hospitalMedicalHistoryBiz.getMedicalHistory(req);
        return BaseResponse.success(result);
    };

}
